Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KubeCon + CloudNativeCon NA '23 demo files #32

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

marcelamelara
Copy link
Contributor

Adding a dedicated directory that contains all of the files and documentation used in the demo showed at Kubecon + CloudNativeCon `23.

Signed-off-by: Marcela Melara <marcela.melara@intel.com>
Signed-off-by: Marcela Melara <marcela.melara@intel.com>
Copy link
Member

@adityasaky adityasaky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM largely. Just minor comments but I don't know if they're dealbreakers given the context...

}

fileScanner := bufio.NewScanner(readFile)
fileScanner.Split(bufio.ScanLines)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? This is the default, right?

Split sets the split function for the Scanner. The default split function is ScanLines.

From https://pkg.go.dev/bufio#Scanner.Split

return fmt.Errorf("error decoding base64-encoded public key: %w", err)
}

// dedup
Copy link
Member

@adityasaky adityasaky Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify this comment?

for _, line := range fileLines {
lineStr := string(line)
if strings.Contains(lineStr, "publicKey") {
pkB64Raw := strings.TrimPrefix(lineStr, " \"publicKey\": ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings.TrimSpace to make this more robust in case the output changes slightly?


for _, line := range fileLines {
lineStr := string(line)
if strings.Contains(lineStr, "publicKey") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think strings.HasPrefix may be better after TrimSpace.

@marcelamelara
Copy link
Contributor Author

Thanks for your comments @adityasaky . I'm actually going to remove all of the Rekor related code since it's experimental and not included in the actual demo.

Signed-off-by: Marcela Melara <marcela.melara@intel.com>
@adityasaky adityasaky merged commit 21e790a into in-toto:main Jan 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants